  <tr>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr><td class=contentheading>
<?php
Echo $a[defspechead];
?></td></tr>
<tr><td>

</td></tr></table>
<?php

 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, p.manufacturers_id, p.products_model,  s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);
    
 $info_box_contents = array();
  $row = 0;
  $col = 0;
  while ($default_specials = tep_db_fetch_array($new)) {
    $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
    $sql = 'SELECT `products_description` FROM `'.TABLE_PRODUCTS_DESCRIPTION.'` WHERE products_id ='.$default_specials['products_id'].' && language_id='.(int)$languages_id;
	$description_query = tep_db_query($sql);
	$description = mysql_fetch_array($description_query, MYSQL_ASSOC);
	$description['products_description'] = substr($description['products_description'], 0, SHORT_DISC_IN_PROD2);
	$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
	$description['products_description'][$desc_len-2] = '.';
	$description['products_description'][$desc_len-3] = '.';
	if (USE_AS_CATALOGUE == "false") {
	if($default_specials['products_quantity'] > 0) {
$adcartbut = tep_image_button('cart_buy.gif', IMAGE_BUTTON_IN_CART);
}else{
$man_query = tep_db_query("select manufacturers_name from ".TABLE_MANUFACTURERS ." where manufacturers_id = '".$default_specials['manufacturers_id']."'");
                 $man_array = tep_db_fetch_array($man_query);
$adcartbut = tep_draw_form('cart_quantity', tep_href_link(FILENAME_QUOTE)) . tep_draw_hidden_field('manufacturer[0]', $man_array['manufacturers_name']) . tep_draw_hidden_field('model[0]', $default_specials['products_model']) .  tep_draw_hidden_field('quantity[0]', '1') . tep_draw_hidden_field('price[0]', $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id']))) .  tep_image_submit('button_request_quote.gif', 'Request Quote');
}
}
if (SHORT_DISC_IN_PROD2 != 0){
$printshortdesc = strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $default_specials["products_id"]). '">' . DESCR_READ_MORE . '</a><br>';
$_MAMBOTS->loadBotGroup( 'content' );
$temp = new stdClass(); 
$temp->text = $printshortdesc;
$result = $_MAMBOTS->trigger( 'onPrepareContent' , array( 1, &$temp, null, 0));
//echo $temp->text;
$printshortdesc = $temp->text;

}
if($default_specials['products_quantity'] > 0) {
    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '"><b>' . $default_specials['products_name'] . '</b></a><br><br>' . $printshortdesc.'<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $default_specials['products_id']) . '">' . $adcartbut . '</a>&nbsp;<s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span><br><br>');
        }
        else
        {
        $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '"><b>' . $default_specials['products_name'] . '</b></a><br><br>' . $printshortdesc . $adcartbut . '<br>&nbsp;<s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span><br><br>');
        }
    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    
    
    }
  }
  new contentBox($info_box_contents);
?>

<!-- default_specials_eof //-->